import time as Time
from datetime import datetime

def curTimeMills() -> int:
    return int(round(Time.time() * 1000))

def str2Timestamp(year:int, date: str, time: str) -> int:
    timeArray = datetime.strptime(str(year) + '-' + date + ' ' + time, "%Y-%m-%d %H:%M:%S.%f")
    timestamp = int(Time.mktime(timeArray.timetuple()) * 1000.0 + timeArray.microsecond / 1000.0)
    return timestamp

def timestamp2Str(timestamp: int) -> int:
    timestamp = float(timestamp)/1000
    timeStr = datetime.fromtimestamp(timestamp).strftime("%Y-%m-%d %H:%M:%S.%f")
    return timeStr